<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "user".
 *
 * @property integer $id
 * @property string $username
 * @property string $password
 * @property string $nick
 * @property string $qrcode
 */
class User extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['username', 'password', 'nick'], 'required'],
            [['username'], 'string', 'max' => 32],
            [['password', 'qrcode'], 'string', 'max' => 256],
            [['nick'], 'string', 'max' => 16],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'username' => Yii::t('app', '登录名'),
            'password' => Yii::t('app', '登录密码'),
            'nick' => Yii::t('app', '昵称'),
            'qrcode' => Yii::t('app', '二维码路径'),
        ];
    }
}
